using DimensionsHelper.LanguageService.Syntax;

namespace DimensionsHelper.LanguageService;

public class AnalysisConstantSignature : AnalysisDeclaration
{
    internal AnalysisConstantSignature(
        ConstantSignature syntaxNode,
        AnalysisNode? parent) :
        base(AnalysisBoundKinds.ConstantSignature, syntaxNode, parent)
    {
        Syntax = syntaxNode;
        Binding = AnalysisNodeFactory.TypeBinding(syntaxNode.Binding, this);
    }

    public override ConstantSignature Syntax { get; }

    public AnalysisTypeBinding Binding { get; }
}


public static partial class AnalysisNodeFactory
{
    /// <summary>
    /// 创建一个常量签名
    /// </summary>
    /// <param name="syntaxNode">原始语法节点</param>
    /// <param name="parent">父节点，可以忽略</param>
    public static AnalysisConstantSignature ConstantSignature(
        ConstantSignature syntaxNode,
        AnalysisNode? parent)
    {
        return new AnalysisConstantSignature(syntaxNode, parent);
    }
}
